import React, { Component } from 'react';
import { index_nav } from '../../utils/api'
import './Mynav.scss'
class Mynav extends Component {
    constructor(props){
        super(props)
        this.state={
            navList:[]
        }
    }
    componentDidMount(){
        index_nav().then((res)=>{
            this.setState({
                navList:res.data.list
            })
            // console.log(res);
        })
    }
    render() {
        return (
            <div className='myNav'>
                <div className='text'>1分抵1元。请您点击此处查看《购物须知》</div>
                {
                    this.state.navList.map((item,index)=>{
                        return (
                            <div className='item' key={index}>
                                <img src={item.pic} alt="" />
                                <span>{item.name}</span>
                            </div>
                        )
                    })
                }
            </div>
        );
    }
}

export default Mynav;